//应用配置
import Datastore from 'react-native-local-mongodb';
import AsyncStorage from '@react-native-async-storage/async-storage';
import callbackToPromise from './callbackToPromise';
const db = new Datastore({
  filename: 'localMongoDbAppConfig',
  storage: AsyncStorage,
  autoload: true,
});
db.ensureIndex(
  {fieldName: 'cKey', unique: true, sparse: false},
  function (err) {
    if (err) {
      console.log('创建索引.localMongoDbAppConfig.err', err);
    }
  },
);
callbackToPromise(db);

export default db;
